// 导入vue-router
import {createRouter, createWebHistory} from 'vue-router'

// 导入组件
import LoginVue from '@/views/Login.vue'
import LayoutVue from '@/views/Layout.vue'
import Login from "@/views/Login.vue";
import UserList from "@/views/UserList.vue";
// import UserList from '@/views/user/UserList.vue'
// import EditPassword from '@/views/user/EditPassword.vue'
// import DisplayUser from '@/views/user/DisplayUser.vue'

// 定义路由关系
const routes = [
    {
        path: '/',
        redirect: '/login'
    },
    {
        path: '/login',
        component: LoginVue
    },
    {
        path: '/index', component: LayoutVue, redirect: '', children: [
            // {
            //     path: '/user/userlist', name: "/user/userlist", component: UserList, meta: {
            //         title: "用户列表"
            //     },
            // },
            // {
            //     path: '/user/editpassword', name: "/user/editpassword", component: EditPassword, meta: {
            //         title: "修改密码"
            //     }
            // },
            // {
            //     path: '/user/displayuser', name: "/user/displayuser", component: DisplayUser, meta: {
            //         title: "个人信息"
            //     }
            // }
        ],

    },
    {
        path: '/user/userlist',
        name: 'UserList',
        component: UserList
    }
]

// 创建路由器
const router = createRouter({
    history: createWebHistory(),
    routes: routes
})

export default router
